package org.leo.geocode.main;

import java.io.IOException;
import java.net.MalformedURLException;
import java.util.List;

import org.leo.geocode.service.GeoCoder;
import org.leo.geocode.util.GeocodeResponse;
import org.leo.geocode.util.GeocodeResponse.Result;

import com.google.gson.JsonIOException;
import com.google.gson.JsonSyntaxException;

public class GeoCodePOC {

	/**
	 * @param args
	 * @throws IOException 
	 * @throws MalformedURLException 
	 * @throws JsonIOException 
	 * @throws JsonSyntaxException 
	 */
	public static void main(String[] args) throws JsonSyntaxException, JsonIOException, MalformedURLException, IOException {
		GeoCoder geoCoder = new GeoCoder();
		GeocodeResponse geocodeResponse = geoCoder.getLocation("613 W 57TH AV CA");
		List<Result> results = geocodeResponse.getResults();
		for (Result result : results) {
			System.out.println("Result latitude :" + result.getGeometry().getLocation().getLat());
			System.out.println("Result longitude :" + result.getGeometry().getLocation().getLng());
			System.out.println("\n");
		}
	}

}
